﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Web.UI.WebControls;
using System.Text;
using System.Web.Mvc;

using Domzs.Web.Mvc.ActionResults;

namespace System.Web.Mvc
{
    public static class ExcelControllerExtensions
    {
        public static ActionResult Excel(this Controller controller, DataContext dataContext, IQueryable rows, string fileName)
        {
            return new ExcelResult(dataContext, rows, fileName, null, null, null, null);
        }

        public static ActionResult Excel(this Controller controller, DataContext dataContext, IQueryable rows, string fileName, string[] headers)
        {
            return new ExcelResult(dataContext, rows, fileName, headers, null, null, null);
        }

        public static ActionResult Excel(this Controller controller, DataContext dataContext, IQueryable rows, string fileName, string[] headers, TableStyle tableStyle, TableItemStyle headerStyle, TableItemStyle itemStyle)
        {
            return new ExcelResult(dataContext, rows, fileName, headers, tableStyle, headerStyle, itemStyle);
        }
    }
}
